namespace Collaboris.Saf.Actions.Wss.Tests.Generated
{
    using Engine.Report;

    using Microsoft.SharePoint;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Saf.Tests;
    using Entities;
    using File;

    using SharePoint.Wss.Files;

    /// <summary>
    /// This test was originally generated but has now been tested and verfiied by MJ
    /// </summary>
    [TestClass]
    public class CheckOutFileTest
    {
        [TestMethod]
        public void CheckOutFile_Test()
        {
            WSSTestAssistant<CheckOutFile, CheckOutFileInfo> checkoutfile =
                    new WSSTestAssistant<CheckOutFile, CheckOutFileInfo>(TestEnvironment.PublishingSite, 
                        "CheckOutFileTestWeb", "BLANKINTERNET#0");

            using (checkoutfile)
            {
                MacroReport doReport = checkoutfile.DoMacro();

                SPFile defaultAspx1 = SPFileHelper.GetFile(checkoutfile.TestWeb, "Pages", "default.aspx");
                Assert.IsTrue(defaultAspx1.CheckOutStatus == SPFile.SPCheckOutStatus.LongTerm);

                MacroReport unDoReport = checkoutfile.UndoMacro();

                SPFile defaultAspx2 = SPFileHelper.GetFile(checkoutfile.TestWeb, "Pages", "default.aspx");
                Assert.IsTrue(defaultAspx2.CheckOutStatus == SPFile.SPCheckOutStatus.None);
            }
        }

    }
}
